const webpack = require('webpack');

module.exports = {
    lintOnSave: false,
    publicPath: './',
    devServer: {
        port: "9528",
        proxy: { // 配置跨域
            // '/api': {
            //     target: 'http://172.16.53.119:609', //请求接口域名
            //     ws: true,
            //     secure: false,
            //     changOrigin: true, //是否允许跨越
            //     pathRewrite: {
            //         '^/api': ''
            //     }
            // },
            '/mgr': {
                target: 'http://172.16.54.190:7090', //请求接口域名
                ws: true,
                secure: false,
                changOrigin: true, //是否允许跨越
                pathRewrite: {
                    '^/mgr': ''
                }
            }
        }
    },
    configureWebpack: {
        name: "佳信机器人",
        resolve: {
            fallback: { path: require.resolve("path-browserify") }
        }
    },
    chainWebpack: config => {
        config.plugin('provide').use(webpack.ProvidePlugin, [{
            $: 'jquery',
            jquery: 'jquery',
            jQuery: 'jquery',
            'window.jQuery': 'jquery'
        }])
    },
    configureWebpack: {
        resolve: {
            fallback: { path: require.resolve("path-browserify") }
        },
    },
    css: {
        loaderOptions: {
            less: {
                lessOptions: {
                    // If you are using less-loader@5 please spread the lessOptions to options directly
                    modifyVars: {
                        'primary-color': '#6B5EE2',
                        'link-color': '#1DA57A',
                        'border-radius-base': '2px',
                    },
                    javascriptEnabled: true,
                },
            },
        },
    },
}